import Util from "./util";
import {get_device, 初始化漏汽信息, 初始化疏水信息, 抽汽信息描述, 抽汽信息设置} from "@/components/js/settings";
import Systemdemo from "@/components/js/systemdemo";
import SystemDemo from "@/components/js/systemdemo";

export function onclick(idStr, param) {
    if (typeof wps.Enum != "object") {
        wps.Enum = Util.WPS_Enum;
    }
    switch (idStr) {
        case "确定": {
            // 优先从存储的字符串中加载信息，因为用户可能编辑存储的字符串
            let checked_pos = []
            for (let i in this.pos) {
                let ele = document.getElementById(i)
                if (ele.checked) {
                    checked_pos.push(i)
                }
            }
            if (checked_pos.length === 1) {
                SystemDemo.fill_cell(null, null, "para", `=${checked_pos[0]}`)
            } else if (checked_pos.length === 0) {
                wps.ShowDialog("/", "未选中测点")
                return
            } else {
                SystemDemo.fill_cell(null, null, "formula", `=AVERAGE(${checked_pos.join(",")})`)
            }
            // tpi.onclick(id);

            // this.$forceUpdate();
            this.Visible=false;

            break;
        }
    }
}



export default {
    onclick,
};

